package com.icss.service.impl;

import com.icss.domain.User;
import com.icss.mapper.UserMapper;
import com.icss.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service("userService")
public class UserServiceImpl implements UserService {
   @Autowired
   private UserMapper userMapper;
//    @Transactional(readOnly = true)
    public List<User> findAll() {
        List<User> allUser = userMapper.findAllUser();
        System.out.println("用戶查找...");
        return allUser;
    }
//    @Transactional(rollbackFor = {Throwable.class})
    public void deleteById(Integer id) {
        System.out.println("用户删除...");
        userMapper.deleteById(id);

    }
}
